#! /bin/bash
# $Id: mkdistbins,v 1.2 2010/01/27 00:50:46 mp Exp $
distdir=/mgl/works/rhuey/autodocksuite-4.2.3
archlist="i86Cygwin i86Linux2 sun4SunOS5 ia64Linux2 universalDarwin8 universalDarwin9 universalDarwin10"
proglist="autodock autogrid"
version=4
umask 0

run=echo # debugging

for arch in $archlist; do
   archok=y

   case $arch in 
    i86Cygwin) exeext=.exe ;;
    *) exeext="";;
    esac
    
    case $arch in
    *Darwin*) config_cmd="../configure-universalDarwin" ;;
    *) config_cmd="../configure";;
    esac

    case $arch in
    i86Cygwin) host=hao;; # dummy
    i86Linux2) host=saul;;
    sun4SunOS5) host=riscfs2;;
    ia64Linux2) host=abraham;;
    universalDarwin8) host=rapa;;
    universalDarwin9) host=esau;;
    universalDarwin10) host=luna;;
    *) host=dummy;;
    esac

    for prog in autodock autogrid; do
        $run "umask 0; mkdir $distdir/$prog/$arch"
        # wish list:
        rcmd="umask 0;cd $distdir/$prog/$arch; $config_cmd; make; make test"
        $run ssh $host \"$rcmd\"
   done
done

